// 创建一个路由器，并暴露出去
// 第一步：引入createRouter
import {createRouter, createWebHistory} from "vue-router";
// 引入一个一个可能要呈现组件
import Layout from "@/views/Layout.vue";
import Login from "@/views/Login.vue";
import User from "@/views/User.vue";
import Blog from "@/views/Blog.vue";
import BlogType from "@/views/BlogType.vue";

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: [
        {path: "/login", component: Login},
        {
            path: "/", component: Layout, children: [
                {path: "/user", component: User},
                {path: "/blog", component: Blog},
                {path: "/blogType", component: BlogType}
            ]
        }
    ]
})

// 暴露出去router
export default router